import {
    request
} from './request'

//获取登录接口
export function getLogin(phone, password, captcha) {
    return request({
        url: '/login/cellphone',
        params: {
            phone,
            password,
            captcha
        }
    })
}

//获取用户信息
export function getUserInfo(uid) {
    return request({
        url: '/user/detail',
        params: {
            uid
        }
    })
}


//查询用户私人歌单
export function getUserPrivatePlayList(uid) {
    return request({
        url: '/user/playlist',
        params: {
            uid
        }
    })
}

//获取喜欢音乐列表
export function getLikeList(id) {
    return request({
        url: '/playlist/detail',
        params: {
            id
        }
    })
}

//获取歌单歌曲列表信息
export function getMusicDetailList(ids) {
    return request({
        url: '/song/detail',
        params: {
            ids
        }
    })
}

//获取用户关注信息
export function getUserFollows(uid, limit, offset) {
    return request({
        url: '/user/follows',
        params: {
            uid,
            limit,
            offset
        }
    })
}
//获取用户关注数量信息
export function getUserFollowsCount(uid, limit) {
    return request({
        url: '/user/follows',
        params: {
            uid,
            limit
        }
    })
}

//获取用户粉丝信息
export function getUserFolloweds(uid, limit, offset) {
    return request({
        url: '/user/followeds',
        params: {
            uid,
            limit,
            offset
        }
    })
}
//获取用户粉丝数量信息
export function getUserFollowedsCount(uid, limit) {
    return request({
        url: '/user/followeds',
        params: {
            uid,
            limit
        }
    })
}

//关注用户
export function Follow(id, t) {
    return request({
        url: '/follow',
        params: {
            id,
            t
        }
    })
}

//签到
export function signIn() {
    return request({
        url: '/daily_signin',
        params: {
            type: 0
        }
    })
}

//编辑用户资料
export function UserEdit(gender,
    birthday,
    nickname,
    province,
    city,
    signature) {
    return request({
        url: '/user/update',
        params: {
            gender,
            birthday,
            nickname,
            province,
            city,
            signature
        }
    })
}

//修改用户头像
export function EditCover(data) {
    return request({
        method: 'post',
        url: '/avatar/upload',
        headers: {
            'Content-Type': 'multipart/form-data',
        },
        data
    })
}

//获取验证码
export function getCaptcha(phone) {
    return request({
        url: '/captcha/sent',
        params: {
            phone
        }
    })
}
//获取私信内容
export function getPrivate(limit, offset) {
    return request({
        url: '/msg/private',
        params: {
            limit,
            offset
        }
    })
}

//发送私信
export function sendText(user_ids, msg) {
    return request({
        url: '/send/text',
        params: {
            user_ids,
            msg
        }
    })
}


//获取用户私信内容
export function getUserPrivate(uid, limit, before) {
    return request({
        url: '/msg/private/history',
        params: {
            uid,
            limit,
            before
        }
    })
}


//获取通知——评论内容
export function getUserComment(uid, limit, before) {
    return request({
        url: '/msg/comments',
        params: {
            uid,
            limit,
            before
        }
    })
}

//获取通知——@我内容
export function getUserForwards(limit, offset) {
    return request({
        url: '/msg/forwards',
        params: {
            limit,
            offset
        }
    })
}

//获取通知——通知内容
export function getUserNotices(limit, lasttime) {
    return request({
        url: '/msg/notices',
        params: {
            limit,
            lasttime
        }
    })
}

//乐签信息
export function getSignInfo() {
    return request({
        url: '/sign/happy/info',
        params: {}
    })
}

//刷新登录
export function refresh() {
    return request({
        url: 'login/refresh',
        params: {}
    })
}